import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import Dept from '../views/system/Dept.vue'
const routes = [
  {
    path: '/',
    redirect: '/login'  //当页面方位localhost:8080/   的时候需要重定向到 localhost:8080/login  然后会跳转到Login.vue页面
  },
  {
    path:'/login',
    name: 'Login',
    component:() => import('../views/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    redirect: '/system/welcome',
    children: [
      {
        path: '/system/welcome',
        name: 'Welcome',
        component: () => import( '../views/Welcome.vue'), //系统欢迎页
      },
      {
        path:'/system/menus',
        name: 'Menus',
        component:() => import('../views/system/Menu.vue')
      },
      {
        path:'/system/departments',
        name:'Dept',
        component: Dept
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
